// utils/pitchfinder-yin.js
import { YIN } from 'pitchfinder';

const detectPitch = YIN({ sampleRate: 44100 }); // 只创建一次

export const analyzeFrequency = (buffer) => {
  return detectPitch(buffer);
};